// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from '@/App'
import router from '@/router'                 // api: https://github.com/vuejs/vue-router
import store from '@/store'                   // api: https://github.com/vuejs/vuex
import VueCookie from 'vue-cookie'
import '@/icons'
import '@/assets/scss/index.scss'
import httpRequest from '@/utils/httpRequest'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import cloneDeep from 'lodash/cloneDeep'
import commonVar from '@/assets/commonVar.vue'
Vue.use(VueCookie)
Vue.use(ElementUI);

Vue.config.productionTip = false

// 挂载全局
Vue.prototype.$http = httpRequest // ajax请求方法
Vue.prototype.$cloneDeep = cloneDeep
Vue.prototype.$common = commonVar

// 保存整站vuex本地储存初始状态
let old = cloneDeep(store.state)
sessionStorage.setItem('storeState',JSON.stringify(old));

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})
